﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

using Microsoft.Xna.Framework;

namespace VoxelModel
{
    public class FPSCounter
    {
        public int frameRate, frameCounter;

        private Stopwatch stopWatch;

        public FPSCounter()
        {
            stopWatch = new Stopwatch();

            stopWatch.Start();
        }

        public void Update()
        {
            if (stopWatch.ElapsedMilliseconds > 1000)
            {
                stopWatch.Restart();

                frameRate = frameCounter;
                frameCounter = 0;
            }

            frameCounter++;
        }
    }
}
